<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>

<form:form commandName="taskNew" cssClass="form-horizontal" role="form">
    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right">任务名称</label>
        <div class="col-sm-8">
            <input type="text" value="${taskNew.taskName}" class="form-control" readonly>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right">任务内容</label>
        <div class="col-sm-8">
            <textarea rows="5" class="form-control" readonly>${taskNew.content}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right">任务附件</label>
        <c:if test="${empty taskNew.file}">
            <div class="col-sm-3">
                <input type="text" value="无任务附件" class="form-control" readonly>
            </div>
        </c:if>
        <c:if test="${!empty taskNew.file}">
            <div class="col-sm-2">
                <input type="button" value="下载" onclick="downDetail('${taskNew.file}')" style="width: 100%; height: 32px;"
                       class="btn-large btn-primary"/>
            </div>
        </c:if>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right">分管领导</label>
        <div class="col-sm-3">
            <input type="text" value="${taskNew.leader}" class="form-control" readonly>
        </div>
        <label class="col-sm-2 control-label no-padding-right">任务时限</label>
        <div class="col-sm-3">
            <input type="text" value="${taskNew.dateTime}" class="form-control" readonly/>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right">督查人</label>
        <div class="col-sm-3">
            <input type="text" value="${taskNew.operator}" class="form-control" readonly>
        </div>
        <label class="col-sm-2 control-label no-padding-right">督查人电话</label>
        <div class="col-sm-3">
            <input type="text" value="${taskNew.operatorTel}" class="form-control" readonly>
        </div>
    </div>
    <div class="form-group" style="position: relative;">
        <label class="col-sm-2 control-label no-padding-right">文号</label>
        <div class="col-sm-3">
            <input type="text" value="${taskNew.referenceNumber}" class="form-control" readonly>
        </div>
        <label class="col-sm-2 control-label no-padding-right">事项类型</label>
        <div class="col-sm-3">
            <c:if test="${taskNew.categoryId == '01'}">
                <input type="text" value="会议纪要" class="form-control" readonly>
            </c:if>
            <c:if test="${taskNew.categoryId == '02'}">
                <input type="text" value="省市县为民办实事" class="form-control" readonly>
            </c:if>
            <c:if test="${taskNew.categoryId == '03'}">
                <input type="text" value="省市县政府工作报告" class="form-control" readonly>
            </c:if>
            <c:if test="${taskNew.categoryId == '04'}">
                <input type="text" value="政协提案办理" class="form-control" readonly>
            </c:if>
            <c:if test="${taskNew.categoryId == '05'}">
                <input type="text" value="县长批示件" class="form-control" readonly>
            </c:if>
            <c:if test="${taskNew.categoryId == '06'}">
                <input type="text" value="人大建议办理" class="form-control" readonly>
            </c:if>
            <c:if test="${taskNew.categoryId == '07'}">
                <input type="text" value="其他事项" class="form-control" readonly>
            </c:if>
        </div>
    </div>
    <%--会议纪要内容DIV--%>
    <div id="hyjyContent">
        <c:if test="${not empty sendList}">
            <c:forEach items="${sendList}" var="send">
                <div class="form-group">
                    <c:if test="${!empty send.remark}">
                    <label class="col-sm-2 control-label no-padding-right">议点</label>
                    <div class="col-sm-3">
                        <input type="text" value="${send.remark}" class="form-control" readonly>
                    </div>
                    </c:if>
                    <label class="col-sm-2 control-label no-padding-right">承办单位</label>
                    <div class="col-sm-3">
                        <input type="text" value="${send.departName}" class="form-control" readonly>
                    </div>
                </div>

                <c:forEach items="${workableList}" var="workable">
                    <c:if test="${send.sysId == workable.sendId}">
                        <div class="form-group">
                            <label class="col-sm-2 control-label no-padding-right">${send.departName}经办人</label>
                            <div class="col-sm-3">
                                <input type="text" value="${workable.operator}" class="form-control" readonly>
                            </div>
                            <label class="col-sm-2 control-label no-padding-right">${send.departName}经办人电话</label>
                            <div class="col-sm-3">
                                <input type="text" value="${workable.operatorTel}" class="form-control" readonly>
                            </div>
                        </div>
                    </c:if>
                </c:forEach>

                <c:if test="${!empty send.file}">
                    <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right">${send.departName}反馈附件</label>
                        <div class="col-sm-2">
                            <input type="button" value="下载" onclick="downDetail('${send.file}')" style="width: 100%; height: 32px;"
                                   class="btn-large btn-primary"/>
                        </div>
                    </div>
                </c:if>
                <c:if test="${!empty send.feedback}">
                    <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right">${send.departName}反馈内容</label>
                        <div class="col-sm-8">
                            <textarea rows="2" class="form-control" readonly>${send.feedback}</textarea>
                        </div>
                    </div>
                </c:if>
            </c:forEach>
        </c:if>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="type">是否办结</label>
        <div class="col-sm-3">
            <select name="type" id="type" class="form-control required">
                <option value="">点击选择</option>
                <option value="3" <c:if test="${taskNew.type == '3'}">selected="selected"</c:if>>办结</option>
                <option value="4" <c:if test="${taskNew.type == '4'}">selected="selected"</c:if>>未办结</option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="comment">任务评价</label>
        <div class="col-sm-8">
            <textarea rows="5" id="comment" name="comment" class="form-control required">${taskNew.comment}</textarea>
        </div>
    </div>

    <input type="hidden" name="sysId" id="sysId" value="${taskNew.sysId}">

</form:form>
<script src="<s:url value="/assets/js/chosen.jquery.js"></s:url>"></script>
<script src="<s:url value="/assets/js/ajaxfileupload.js"></s:url>"></script>
<script src="<s:url value="/assets/js/modal/modal.js"></s:url>"></script>

<script type="text/javascript">
    //下载按钮
    function downDetail(id) {
        var url = "/filesUpload/download/" + id;
        window.open(url);
    }
</script>
